
package com.hlkj.pay.service.merchant;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.math.BigDecimal;
import java.util.List;

import com.hlkj.framework.common.pojo.PageResult;
import com.hlkj.pay.dto.merchant.MerchantInfoDto;
import com.hlkj.pay.dto.merchant.MerchantInfoQueryDto;
import com.hlkj.pay.dto.merchant.MerchantInfoRegisterDto;
import com.hlkj.pay.enums.CommonEnum;
import com.hlkj.pay.infrastructure.model.finance.MerchantAmountDO;
import com.hlkj.pay.infrastructure.model.merchant.MerchantInfoDO;

/**
 * @author HlpayTeam
 * @date 2024/09/12 13:40
 */
public interface IMerchantService {

    /**
     * 商户注册
     * 
     * @param merchantInfoRegisterDto
     * @return
     */
    String register(MerchantInfoRegisterDto merchantInfoRegisterDto);

    /**
     *
     * @param account
     * @return
     */
    MerchantInfoDO queryMerchantByAccount(String account);

    /**
     * query list
     * 
     * @param merchantInfoQueryDto
     * @return
     */
    List<MerchantInfoDO> queryList(MerchantInfoQueryDto merchantInfoQueryDto);

    /**
     * 通过商户sn列表查询
     * 
     * @param snList
     * @return
     */
    List<MerchantInfoDO> queryList(List<String> snList);

    /**
     *
     * @param sn
     * @return
     */
    MerchantInfoDO queryMerchant(String sn);

    MerchantInfoDO queryMerchantNoCache(String sn);

    /**
     * 通过sn 更新商户信息
     * 
     * @param merchantInfoDO
     */
    void updateMerchantBySn(MerchantInfoDO merchantInfoDO);

    /**
     * page query
     * 
     * @param merchantInfoQueryDto
     * @return
     */
    PageResult<MerchantInfoDto> queryPage(MerchantInfoQueryDto merchantInfoQueryDto);

    /**
     * delete
     * 
     * @param sn
     */
    void delMerchant(String sn);

    /**
     *
     * @param sn
     * @return
     */
    List<String> queryMerchantByAgentId(String sn);

    /**
     *
     * @param sn
     * @return
     */
    MerchantAmountDO queryMerchantAmount(String sn);

    /**
     *
     * @param sn
     * @return
     */
    BigDecimal queryMerchantFeeAmount(String sn);

    /**
     *
     * @param sn
     * @param feeAmount
     * @param YES
     *            + NO -
     * @return
     */
    void updateMerchantFeeAmount(String sn, BigDecimal feeAmount, CommonEnum.YES_NO_TYPE changeType);

    void addMerchantAmount(MerchantAmountDO merchantAmountDO);

    void updateMerchantAmount(MerchantAmountDO merchantAmountDO);

    /**
     *
     * @param orderSn
     */
    void syncMerchantFeeAmount(String orderSn);

    /**
     * 商户数量统计
     * @param merchantInfoQueryDto
     * @return
     */
    Long queryMerchantCount(MerchantInfoQueryDto merchantInfoQueryDto);

}
